Repository navigation
test(maths): strengthen armstrongNumber tests against mutation (R50-T050) - #98
Open
aniruddha-bongale wants to merge 1 commit into
Open
aniruddha-bongale wants to merge 1 commit into
aniruddha-bongale wants to merge 1 commit into
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Strengthen unit test coverage for
armstrongNumberinMaths/ArmstrongNumber.jsto build a mutation-resistant regression test suite. Prove that the regression tests detect plausible one-line mistakes (such as off-by-one boundary errors rejecting the smallest valid input 0 and hardcoded cube power mutations failing multi-digit Armstrong numbers like 1634) while preserving documented public behavior. Provide an automated check runnerwork/R50-T050/check.pysaving verification results towork/R50-T050/results.json.Related Issue
Fixes: #50
Type of Change
Changes Made
Maths/ArmstrongNumber.jsidentifying protected semantic conditions and preconditions:num < 0permits the smallest valid input 0 (num <= 0.** numStr.lengthdynamically scales with digit count, protecting against hardcoded cube mutations (** 3) for 4-digit Armstrong numbers (e.g. 1634).Maths/test/ArmstrongNumber.test.js:work/R50-T050/check.pyexecuting native tests, validating original behavior against all fixtures, and demonstrating that deliberate one-line mutants fail the named assertions for semantic reasons while the original passes.Screenshots / Recordings
All 9 unit tests for
ArmstrongNumberpassed cleanly. Both mutant detection proofs passed.Testing
npm test -- Maths/test/ArmstrongNumber.test.js- all 9 tests passed.python3 work/R50-T050/check.py- original assertions verified and mutants caught.Checklist
Additional Notes
Student: Aniruddha Bongale (Enrollment: E26B07F0827)
Task ID: R50-T050